#ifndef _FTEXTINSTRUCTIONS_H_
#define _FTEXTINSTRUCTIONS_H_

namespace Font
{

	struct TextCommand
	{
		Instruction::List type;
		unsigned int data;
	};

	class TextInstructions
	{
	
	public:
	
		TextInstructions(Library* a_Library);
		~TextInstructions();

		void Clear();

		void SetCommand(Instruction::List a_Type, unsigned int a_Data = 0);

		unsigned int GetTextLength();
		unsigned int GetCodePointCount();
		unsigned int GetInstructionCount();

		virtual bool SetTextData(const unsigned char* a_String) = 0;
		virtual bool AdvanceCommand() = 0;

		const TextCommand& GetCommand();
	
	protected:

		Library* m_Library;

		TextCommand m_CommandCurrent;
		unsigned int m_TextLength;
		unsigned int m_CodePointCount;
		unsigned int m_InstructionCount;
	
	}; // class TextInstructions

	class InterfaceInstructions
	{
	
	public:
	
		InterfaceInstructions();
		~InterfaceInstructions();
	
		virtual void Clear() = 0;

		virtual bool SetText(const unsigned char* a_String) = 0;
		virtual unsigned int GetTextLength() = 0;

		virtual void SetCommand(Instruction::List a_Type, unsigned int a_Data = 0) = 0;
		virtual bool NextCommand() = 0;
		virtual const TextCommand& GetCommand() = 0;
	
	}; // class InterfaceInstructions

	class InstructionsUtf16 : public InterfaceInstructions
	{
	
	public:
	
		InstructionsUtf16(Library* a_Library);
		~InstructionsUtf16();
	
		void Clear();

		bool SetText(const unsigned char* a_String) = 0;
		unsigned int GetTextLength();

		void SetCommand(Instruction::List a_Type, unsigned int a_Data = 0);
		bool NextCommand();
		const TextCommand& GetCommand();

	protected:

		Library* m_Library;

		TextCommand m_CommandCurrent;

		const wchar_t* m_Text;
		const wchar_t* m_TextCursor;
		unsigned int m_TextLength;
	
	}; // class InstructionsUtf16

}; // namespace Font
	
#endif